package com.test;

import org.dozer.DozerBeanMapper;

import java.util.Collections;
import java.util.Date;

/**
 * Created by frinder on 2017/5/18.
 */
public class DateConverterDemo {

    public static void main(String[] args) {
        DozerBeanMapper mapper = new DozerBeanMapper();
        mapper.setMappingFiles(Collections.singletonList("dozer.xml"));
        Src src = new Src();
        Dest dest = mapper.map(src, Dest.class);
        System.out.println(dest);
    }


    public static class Src {
        private String date = "2018-01-01 16:40";

        public String getDate() {
            return date;
        }

        public void setDate(String date) {
            this.date = date;
        }
    }


    public static class Dest {
        private Date date;

        public Date getDate() {
            return date;
        }

        public void setDate(Date date) {
            this.date = date;
        }

        @Override
        public String toString() {
            return "Dest{" +
                    "date=" + date +
                    '}';
        }
    }

}
